Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors context passing #5623

Merged
merged 1 commit into from
Jul 28, 2023
Merged

Refactors context passing #5623

merged 1 commit into from
Jul 28, 2023

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented Jul 28, 2023

What's the problem this PR addresses?

Passing the context to the CLI instance was impractical, as it required to know exactly what was the context that the commands expect. I think there's something to improve here in Clipanion itself (perhaps so that the context can be defined when instantiating the CLI, not running the first command), but that's for a separate time.

How did you fix it?

I made getCliBase add a defaultContext field to the CLI instance. I considered returning them as separate fields, but wasn't sure it'd be worth the hassle of conveying two different values. Might revisit in a follow-up PR.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis arcanis merged commit 7a433ba into master Jul 28, 2023
15 checks passed
@arcanis arcanis deleted the mael/cli-context branch July 28, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant